/**
 * @file        main.c
 * @author      Shadow3D (ShadowThreeD@outlook.com)
 * @brief       compiler with "gcc -Wall .\string_len.c"
 * @version     0.1
 * @date        2022-01-19
 * 
 * @copyright   Copyright (c) 2022
 * 
 */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define NAME    "Shadow"

int main(void)
{
    char *name = malloc(20);

    memcpy(name, NAME, sizeof(NAME));

    printf("name = %s, len = %d\r\n", name, sizeof(NAME));      /* name = Shadow, len = 7 */
    printf("name = %s, len = %d\r\n", name, sizeof(name));      /* name = Shadow, len = 4 */    /* sizeof(char*) */
    printf("name = %s, len = %d\r\n", name, strlen(name));      /* name = Shadow, len = 6 */

    free(name);

    return 0;
}